home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / tools / gcc / gcc270_src.lha / gcc-2.7.0-amiga / gcc.info-3 < prev    next >
Encoding:
GNU Info File  |  1995-06-16  |  47.1 KB  |  1,210 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.  
  4.    This file documents the use and the internals of the GNU compiler.
  5.  
  6.    Published by the Free Software Foundation 59 Temple Place - Suite 330
  7. Boston, MA 02111-1307 USA
  8.  
  9.    Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995 Free Software
  10. Foundation, Inc.
  11.  
  12.    Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.  
  16.    Permission is granted to copy and distribute modified versions of
  17. this manual under the conditions for verbatim copying, provided also
  18. that the sections entitled "GNU General Public License," "Funding for
  19. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  20. included exactly as in the original, and provided that the entire
  21. resulting derived work is distributed under the terms of a permission
  22. notice identical to this one.
  23.  
  24.    Permission is granted to copy and distribute translations of this
  25. manual into another language, under the above conditions for modified
  26. versions, except that the sections entitled "GNU General Public
  27. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  28. `Look And Feel'", and this permission notice, may be included in
  29. translations approved by the Free Software Foundation instead of in the
  30. original English.
  31.  
  32. 
  33. File: gcc.info,  Node: Warning Options,  Next: Debugging Options,  Prev: C++ Dialect Options,  Up: Invoking GCC
  34.  
  35. Options to Request or Suppress Warnings
  36. =======================================
  37.  
  38.    Warnings are diagnostic messages that report constructions which are
  39. not inherently erroneous but which are risky or suggest there may have
  40. been an error.
  41.  
  42.    You can request many specific warnings with options beginning `-W',
  43. for example `-Wimplicit' to request warnings on implicit declarations.
  44. Each of these specific warning options also has a negative form
  45. beginning `-Wno-' to turn off warnings; for example, `-Wno-implicit'.
  46. This manual lists only one of the two forms, whichever is not the
  47. default.
  48.  
  49.    These options control the amount and kinds of warnings produced by
  50. GNU CC:
  51.  
  52. `-fsyntax-only'
  53.      Check the code for syntax errors, but don't do anything beyond
  54.      that.
  55.  
  56. `-pedantic'
  57.      Issue all the warnings demanded by strict ANSI standard C; reject
  58.      all programs that use forbidden extensions.
  59.  
  60.      Valid ANSI standard C programs should compile properly with or
  61.      without this option (though a rare few will require `-ansi').
  62.      However, without this option, certain GNU extensions and
  63.      traditional C features are supported as well.  With this option,
  64.      they are rejected.
  65.  
  66.      `-pedantic' does not cause warning messages for use of the
  67.      alternate keywords whose names begin and end with `__'.  Pedantic
  68.      warnings are also disabled in the expression that follows
  69.      `__extension__'.  However, only system header files should use
  70.      these escape routes; application programs should avoid them.
  71.      *Note Alternate Keywords::.
  72.  
  73.      This option is not intended to be useful; it exists only to satisfy
  74.      pedants who would otherwise claim that GNU CC fails to support the
  75.      ANSI standard.
  76.  
  77.      Some users try to use `-pedantic' to check programs for strict ANSI
  78.      C conformance.  They soon find that it does not do quite what they
  79.      want: it finds some non-ANSI practices, but not all--only those
  80.      for which ANSI C *requires* a diagnostic.
  81.  
  82.      A feature to report any failure to conform to ANSI C might be
  83.      useful in some instances, but would require considerable
  84.      additional work and would be quite different from `-pedantic'.  We
  85.      recommend, rather, that users take advantage of the extensions of
  86.      GNU C and disregard the limitations of other compilers.  Aside
  87.      from certain supercomputers and obsolete small machines, there is
  88.      less and less reason ever to use any other C compiler other than
  89.      for bootstrapping GNU CC.
  90.  
  91. `-pedantic-errors'
  92.      Like `-pedantic', except that errors are produced rather than
  93.      warnings.
  94.  
  95. `-w'
  96.      Inhibit all warning messages.
  97.  
  98. `-Wno-import'
  99.      Inhibit warning messages about the use of `#import'.
  100.  
  101. `-Wchar-subscripts'
  102.      Warn if an array subscript has type `char'.  This is a common cause
  103.      of error, as programmers often forget that this type is signed on
  104.      some machines.
  105.  
  106. `-Wcomment'
  107.      Warn whenever a comment-start sequence `/*' appears in a comment.
  108.  
  109. `-Wformat'
  110.      Check calls to `printf' and `scanf', etc., to make sure that the
  111.      arguments supplied have types appropriate to the format string
  112.      specified.
  113.  
  114. `-Wimplicit'
  115.      Warn whenever a function or parameter is implicitly declared.
  116.  
  117. `-Wparentheses'
  118.      Warn if parentheses are omitted in certain contexts, such as when
  119.      there is an assignment in a context where a truth value is
  120.      expected, or when operators are nested whose precedence people
  121.      often get confused about.
  122.  
  123. `-Wreturn-type'
  124.      Warn whenever a function is defined with a return-type that
  125.      defaults to `int'.  Also warn about any `return' statement with no
  126.      return-value in a function whose return-type is not `void'.
  127.  
  128. `-Wswitch'
  129.      Warn whenever a `switch' statement has an index of enumeral type
  130.      and lacks a `case' for one or more of the named codes of that
  131.      enumeration.  (The presence of a `default' label prevents this
  132.      warning.)  `case' labels outside the enumeration range also
  133.      provoke warnings when this option is used.
  134.  
  135. `-Wtrigraphs'
  136.      Warn if any trigraphs are encountered (assuming they are enabled).
  137.  
  138. `-Wunused'
  139.      Warn whenever a variable is unused aside from its declaration,
  140.      whenever a function is declared static but never defined, whenever
  141.      a label is declared but not used, and whenever a statement
  142.      computes a result that is explicitly not used.
  143.  
  144.      To suppress this warning for an expression, simply cast it to
  145.      void.  For unused variables and parameters, use the `unused'
  146.      attribute (*note Variable Attributes::.).
  147.  
  148. `-Wuninitialized'
  149.      An automatic variable is used without first being initialized.
  150.  
  151.      These warnings are possible only in optimizing compilation,
  152.      because they require data flow information that is computed only
  153.      when optimizing.  If you don't specify `-O', you simply won't get
  154.      these warnings.
  155.  
  156.      These warnings occur only for variables that are candidates for
  157.      register allocation.  Therefore, they do not occur for a variable
  158.      that is declared `volatile', or whose address is taken, or whose
  159.      size is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
  160.      structures, unions or arrays, even when they are in registers.
  161.  
  162.      Note that there may be no warning about a variable that is used
  163.      only to compute a value that itself is never used, because such
  164.      computations may be deleted by data flow analysis before the
  165.      warnings are printed.
  166.  
  167.      These warnings are made optional because GNU CC is not smart
  168.      enough to see all the reasons why the code might be correct
  169.      despite appearing to have an error.  Here is one example of how
  170.      this can happen:
  171.  
  172.           {
  173.             int x;
  174.             switch (y)
  175.               {
  176.               case 1: x = 1;
  177.                 break;
  178.               case 2: x = 4;
  179.                 break;
  180.               case 3: x = 5;
  181.               }
  182.             foo (x);
  183.           }
  184.  
  185.      If the value of `y' is always 1, 2 or 3, then `x' is always
  186.      initialized, but GNU CC doesn't know this.  Here is another common
  187.      case:
  188.  
  189.           {
  190.             int save_y;
  191.             if (change_y) save_y = y, y = new_y;
  192.             ...
  193.             if (change_y) y = save_y;
  194.           }
  195.  
  196.      This has no bug because `save_y' is used only if it is set.
  197.  
  198.      Some spurious warnings can be avoided if you declare all the
  199.      functions you use that never return as `noreturn'.  *Note Function
  200.      Attributes::.
  201.  
  202. `-Wenum-clash'
  203.      Warn about conversion between different enumeration types.  (C++
  204.      only).
  205.  
  206. `-Wreorder (C++ only)'
  207.      Warn when the order of member initializers given in the code does
  208.      not match the order in which they must be executed.  For instance:
  209.  
  210.           struct A {
  211.             int i;
  212.             int j;
  213.             A(): j (0), i (1) { }
  214.           };
  215.  
  216.      Here the compiler will warn that the member initializers for `i'
  217.      and `j' will be rearranged to match the declaration order of the
  218.      members.
  219.  
  220. `-Wtemplate-debugging'
  221.      When using templates in a C++ program, warn if debugging is not yet
  222.      fully available (C++ only).
  223.  
  224. `-Wall'
  225.      All of the above `-W' options combined.  These are all the options
  226.      which pertain to usage that we recommend avoiding and that we
  227.      believe is easy to avoid, even in conjunction with macros.
  228.  
  229.    The remaining `-W...' options are not implied by `-Wall' because
  230. they warn about constructions that we consider reasonable to use, on
  231. occasion, in clean programs.
  232.  
  233. `-W'
  234.      Print extra warning messages for these events:
  235.  
  236.         * A nonvolatile automatic variable might be changed by a call to
  237.           `longjmp'.  These warnings as well are possible only in
  238.           optimizing compilation.
  239.  
  240.           The compiler sees only the calls to `setjmp'.  It cannot know
  241.           where `longjmp' will be called; in fact, a signal handler
  242.           could call it at any point in the code.  As a result, you may
  243.           get a warning even when there is in fact no problem because
  244.           `longjmp' cannot in fact be called at the place which would
  245.           cause a problem.
  246.  
  247.         * A function can return either with or without a value.
  248.           (Falling off the end of the function body is considered
  249.           returning without a value.)  For example, this function would
  250.           evoke such a warning:
  251.  
  252.                foo (a)
  253.                {
  254.                  if (a > 0)
  255.                    return a;
  256.                }
  257.  
  258.         * An expression-statement contains no side effects.
  259.  
  260.         * An unsigned value is compared against zero with `<' or `<='.
  261.  
  262.         * A comparison like `x<=y<=z' appears; this is equivalent to
  263.           `(x<=y ? 1 : 0) <= z', which is a different interpretation
  264.           from that of ordinary mathematical notation.
  265.  
  266.         * Storage-class specifiers like `static' are not the first
  267.           things in a declaration.  According to the C Standard, this
  268.           usage is obsolescent.
  269.  
  270.         * If `-Wall' or `-Wunused' is also specified, warn about unused
  271.           arguments.
  272.  
  273.         * An aggregate has a partly bracketed initializer.  For
  274.           example, the following code would evoke such a warning,
  275.           because braces are missing around the initializer for `x.h':
  276.  
  277.                struct s { int f, g; };
  278.                struct t { struct s h; int i; };
  279.                struct t x = { 1, 2, 3 };
  280.  
  281. `-Wtraditional'
  282.      Warn about certain constructs that behave differently in
  283.      traditional and ANSI C.
  284.  
  285.         * Macro arguments occurring within string constants in the
  286.           macro body.  These would substitute the argument in
  287.           traditional C, but are part of the constant in ANSI C.
  288.  
  289.         * A function declared external in one block and then used after
  290.           the end of the block.
  291.  
  292.         * A `switch' statement has an operand of type `long'.
  293.  
  294. `-Wshadow'
  295.      Warn whenever a local variable shadows another local variable.
  296.  
  297. `-Wid-clash-LEN'
  298.      Warn whenever two distinct identifiers match in the first LEN
  299.      characters.  This may help you prepare a program that will compile
  300.      with certain obsolete, brain-damaged compilers.
  301.  
  302. `-Wlarger-than-LEN'
  303.      Warn whenever an object of larger than LEN bytes is defined.
  304.  
  305. `-Wpointer-arith'
  306.      Warn about anything that depends on the "size of" a function type
  307.      or of `void'.  GNU C assigns these types a size of 1, for
  308.      convenience in calculations with `void *' pointers and pointers to
  309.      functions.
  310.  
  311. `-Wbad-function-cast'
  312.      Warn whenever a function call is cast to a non-matching type.  For
  313.      example, warn if `int malloc()' is cast to `anything *'.
  314.  
  315. `-Wcast-qual'
  316.      Warn whenever a pointer is cast so as to remove a type qualifier
  317.      from the target type.  For example, warn if a `const char *' is
  318.      cast to an ordinary `char *'.
  319.  
  320. `-Wcast-align'
  321.      Warn whenever a pointer is cast such that the required alignment
  322.      of the target is increased.  For example, warn if a `char *' is
  323.      cast to an `int *' on machines where integers can only be accessed
  324.      at two- or four-byte boundaries.
  325.  
  326. `-Wwrite-strings'
  327.      Give string constants the type `const char[LENGTH]' so that
  328.      copying the address of one into a non-`const' `char *' pointer
  329.      will get a warning.  These warnings will help you find at compile
  330.      time code that can try to write into a string constant, but only
  331.      if you have been very careful about using `const' in declarations
  332.      and prototypes.  Otherwise, it will just be a nuisance; this is
  333.      why we did not make `-Wall' request these warnings.
  334.  
  335. `-Wconversion'
  336.      Warn if a prototype causes a type conversion that is different
  337.      from what would happen to the same argument in the absence of a
  338.      prototype.  This includes conversions of fixed point to floating
  339.      and vice versa, and conversions changing the width or signedness
  340.      of a fixed point argument except when the same as the default
  341.      promotion.
  342.  
  343.      Also, warn if a negative integer constant expression is implicitly
  344.      converted to an unsigned type.  For example, warn about the
  345.      assignment `x = -1' if `x' is unsigned.  But do not warn about
  346.      explicit casts like `(unsigned) -1'.
  347.  
  348. `-Waggregate-return'
  349.      Warn if any functions that return structures or unions are defined
  350.      or called.  (In languages where you can return an array, this also
  351.      elicits a warning.)
  352.  
  353. `-Wstrict-prototypes'
  354.      Warn if a function is declared or defined without specifying the
  355.      argument types.  (An old-style function definition is permitted
  356.      without a warning if preceded by a declaration which specifies the
  357.      argument types.)
  358.  
  359. `-Wmissing-prototypes'
  360.      Warn if a global function is defined without a previous prototype
  361.      declaration.  This warning is issued even if the definition itself
  362.      provides a prototype.  The aim is to detect global functions that
  363.      fail to be declared in header files.
  364.  
  365. `-Wmissing-declarations'
  366.      Warn if a global function is defined without a previous
  367.      declaration.  Do so even if the definition itself provides a
  368.      prototype.  Use this option to detect global functions that are
  369.      not declared in header files.
  370.  
  371. `-Wredundant-decls'
  372.      Warn if anything is declared more than once in the same scope,
  373.      even in cases where multiple declaration is valid and changes
  374.      nothing.
  375.  
  376. `-Wnested-externs'
  377.      Warn if an `extern' declaration is encountered within an function.
  378.  
  379. `-Winline'
  380.      Warn if a function can not be inlined, and either it was declared
  381.      as inline, or else the `-finline-functions' option was given.
  382.  
  383. `-Woverloaded-virtual'
  384.      Warn when a derived class function declaration may be an error in
  385.      defining a virtual function (C++ only).  In a derived class, the
  386.      definitions of virtual functions must match the type signature of a
  387.      virtual function declared in the base class.  With this option, the
  388.      compiler warns when you define a function with the same name as a
  389.      virtual function, but with a type signature that does not match any
  390.      declarations from the base class.
  391.  
  392. `-Wsynth (C++ only)'
  393.      Warn when g++'s synthesis behavior does not match that of cfront.
  394.      For instance:
  395.  
  396.           struct A {
  397.             operator int ();
  398.             A& operator = (int);
  399.           };
  400.           
  401.           main ()
  402.           {
  403.             A a,b;
  404.             a = b;
  405.           }
  406.  
  407.      In this example, g++ will synthesize a default `A& operator =
  408.      (const A&);', while cfront will use the user-defined `operator ='.
  409.  
  410. `-Werror'
  411.      Make all warnings into errors.
  412.  
  413. 
  414. File: gcc.info,  Node: Debugging Options,  Next: Optimize Options,  Prev: Warning Options,  Up: Invoking GCC
  415.  
  416. Options for Debugging Your Program or GNU CC
  417. ============================================
  418.  
  419.    GNU CC has various special options that are used for debugging
  420. either your program or GCC:
  421.  
  422. `-g'
  423.      Produce debugging information in the operating system's native
  424.      format (stabs, COFF, XCOFF, or DWARF).  GDB can work with this
  425.      debugging information.
  426.  
  427.      On most systems that use stabs format, `-g' enables use of extra
  428.      debugging information that only GDB can use; this extra information
  429.      makes debugging work better in GDB but will probably make other
  430.      debuggers crash or refuse to read the program.  If you want to
  431.      control for certain whether to generate the extra information, use
  432.      `-gstabs+', `-gstabs', `-gxcoff+', `-gxcoff', `-gdwarf+', or
  433.      `-gdwarf' (see below).
  434.  
  435.      Unlike most other C compilers, GNU CC allows you to use `-g' with
  436.      `-O'.  The shortcuts taken by optimized code may occasionally
  437.      produce surprising results: some variables you declared may not
  438.      exist at all; flow of control may briefly move where you did not
  439.      expect it; some statements may not be executed because they
  440.      compute constant results or their values were already at hand;
  441.      some statements may execute in different places because they were
  442.      moved out of loops.
  443.  
  444.      Nevertheless it proves possible to debug optimized output.  This
  445.      makes it reasonable to use the optimizer for programs that might
  446.      have bugs.
  447.  
  448.      The following options are useful when GNU CC is generated with the
  449.      capability for more than one debugging format.
  450.  
  451. `-ggdb'
  452.      Produce debugging information in the native format (if that is
  453.      supported), including GDB extensions if at all possible.
  454.  
  455. `-gstabs'
  456.      Produce debugging information in stabs format (if that is
  457.      supported), without GDB extensions.  This is the format used by
  458.      DBX on most BSD systems.  On MIPS, Alpha and System V Release 4
  459.      systems this option produces stabs debugging output which is not
  460.      understood by DBX or SDB.  On System V Release 4 systems this
  461.      option requires the GNU assembler.
  462.  
  463. `-gstabs+'
  464.      Produce debugging information in stabs format (if that is
  465.      supported), using GNU extensions understood only by the GNU
  466.      debugger (GDB).  The use of these extensions is likely to make
  467.      other debuggers crash or refuse to read the program.
  468.  
  469. `-gcoff'
  470.      Produce debugging information in COFF format (if that is
  471.      supported).  This is the format used by SDB on most System V
  472.      systems prior to System V Release 4.
  473.  
  474. `-gxcoff'
  475.      Produce debugging information in XCOFF format (if that is
  476.      supported).  This is the format used by the DBX debugger on IBM
  477.      RS/6000 systems.
  478.  
  479. `-gxcoff+'
  480.      Produce debugging information in XCOFF format (if that is
  481.      supported), using GNU extensions understood only by the GNU
  482.      debugger (GDB).  The use of these extensions is likely to make
  483.      other debuggers crash or refuse to read the program, and may cause
  484.      assemblers other than the GNU assembler (GAS) to fail with an
  485.      error.
  486.  
  487. `-gdwarf'
  488.      Produce debugging information in DWARF format (if that is
  489.      supported).  This is the format used by SDB on most System V
  490.      Release 4 systems.
  491.  
  492. `-gdwarf+'
  493.      Produce debugging information in DWARF format (if that is
  494.      supported), using GNU extensions understood only by the GNU
  495.      debugger (GDB).  The use of these extensions is likely to make
  496.      other debuggers crash or refuse to read the program.
  497.  
  498. `-gLEVEL'
  499. `-ggdbLEVEL'
  500. `-gstabsLEVEL'
  501. `-gcoffLEVEL'
  502. `-gxcoffLEVEL'
  503. `-gdwarfLEVEL'
  504.      Request debugging information and also use LEVEL to specify how
  505.      much information.  The default level is 2.
  506.  
  507.      Level 1 produces minimal information, enough for making backtraces
  508.      in parts of the program that you don't plan to debug.  This
  509.      includes descriptions of functions and external variables, but no
  510.      information about local variables and no line numbers.
  511.  
  512.      Level 3 includes extra information, such as all the macro
  513.      definitions present in the program.  Some debuggers support macro
  514.      expansion when you use `-g3'.
  515.  
  516. `-p'
  517.      Generate extra code to write profile information suitable for the
  518.      analysis program `prof'.  You must use this option when compiling
  519.      the source files you want data about, and you must also use it when
  520.      linking.
  521.  
  522. `-pg'
  523.      Generate extra code to write profile information suitable for the
  524.      analysis program `gprof'.  You must use this option when compiling
  525.      the source files you want data about, and you must also use it when
  526.      linking.
  527.  
  528. `-a'
  529.      Generate extra code to write profile information for basic blocks,
  530.      which will record the number of times each basic block is
  531.      executed, the basic block start address, and the function name
  532.      containing the basic block.  If `-g' is used, the line number and
  533.      filename of the start of the basic block will also be recorded.
  534.      If not overridden by the machine description, the default action is
  535.      to append to the text file `bb.out'.
  536.  
  537.      This data could be analyzed by a program like `tcov'.  Note,
  538.      however, that the format of the data is not what `tcov' expects.
  539.      Eventually GNU `gprof' should be extended to process this data.
  540.  
  541. `-dLETTERS'
  542.      Says to make debugging dumps during compilation at times specified
  543.      by LETTERS.  This is used for debugging the compiler.  The file
  544.      names for most of the dumps are made by appending a word to the
  545.      source file name (e.g.  `foo.c.rtl' or `foo.c.jump').  Here are the
  546.      possible letters for use in LETTERS, and their meanings:
  547.  
  548.     `M'
  549.           Dump all macro definitions, at the end of preprocessing, and
  550.           write no output.
  551.  
  552.     `N'
  553.           Dump all macro names, at the end of preprocessing.
  554.  
  555.     `D'
  556.           Dump all macro definitions, at the end of preprocessing, in
  557.           addition to normal output.
  558.  
  559.     `y'
  560.           Dump debugging information during parsing, to standard error.
  561.  
  562.     `r'
  563.           Dump after RTL generation, to `FILE.rtl'.
  564.  
  565.     `x'
  566.           Just generate RTL for a function instead of compiling it.
  567.           Usually used with `r'.
  568.  
  569.     `j'
  570.           Dump after first jump optimization, to `FILE.jump'.
  571.  
  572.     `s'
  573.           Dump after CSE (including the jump optimization that sometimes
  574.           follows CSE), to `FILE.cse'.
  575.  
  576.     `L'
  577.           Dump after loop optimization, to `FILE.loop'.
  578.  
  579.     `t'
  580.           Dump after the second CSE pass (including the jump
  581.           optimization that sometimes follows CSE), to `FILE.cse2'.
  582.  
  583.     `f'
  584.           Dump after flow analysis, to `FILE.flow'.
  585.  
  586.     `c'
  587.           Dump after instruction combination, to the file
  588.           `FILE.combine'.
  589.  
  590.     `S'
  591.           Dump after the first instruction scheduling pass, to
  592.           `FILE.sched'.
  593.  
  594.     `l'
  595.           Dump after local register allocation, to `FILE.lreg'.
  596.  
  597.     `g'
  598.           Dump after global register allocation, to `FILE.greg'.
  599.  
  600.     `R'
  601.           Dump after the second instruction scheduling pass, to
  602.           `FILE.sched2'.
  603.  
  604.     `J'
  605.           Dump after last jump optimization, to `FILE.jump2'.
  606.  
  607.     `d'
  608.           Dump after delayed branch scheduling, to `FILE.dbr'.
  609.  
  610.     `k'
  611.           Dump after conversion from registers to stack, to
  612.           `FILE.stack'.
  613.  
  614.     `a'
  615.           Produce all the dumps listed above.
  616.  
  617.     `m'
  618.           Print statistics on memory usage, at the end of the run, to
  619.           standard error.
  620.  
  621.     `p'
  622.           Annotate the assembler output with a comment indicating which
  623.           pattern and alternative was used.
  624.  
  625. `-fpretend-float'
  626.      When running a cross-compiler, pretend that the target machine
  627.      uses the same floating point format as the host machine.  This
  628.      causes incorrect output of the actual floating constants, but the
  629.      actual instruction sequence will probably be the same as GNU CC
  630.      would make when running on the target machine.
  631.  
  632. `-save-temps'
  633.      Store the usual "temporary" intermediate files permanently; place
  634.      them in the current directory and name them based on the source
  635.      file.  Thus, compiling `foo.c' with `-c -save-temps' would produce
  636.      files `foo.i' and `foo.s', as well as `foo.o'.
  637.  
  638. `-print-file-name=LIBRARY'
  639.      Print the full absolute name of the library file LIBRARY that
  640.      would be used when linking--and don't do anything else.  With this
  641.      option, GNU CC does not compile or link anything; it just prints
  642.      the file name.
  643.  
  644. `-print-prog-name=PROGRAM'
  645.      Like `-print-file-name', but searches for a program such as `cpp'.
  646.  
  647. `-print-libgcc-file-name'
  648.      Same as `-print-file-name=libgcc.a'.
  649.  
  650.      This is useful when you use `-nostdlib' or `-nodefaultlibs' but
  651.      you do want to link with `libgcc.a'.  You can do
  652.  
  653.           gcc -nostdlib FILES... `gcc -print-libgcc-file-name`
  654.  
  655. `-print-search-dirs'
  656.      Print the name of the configured installation directory and a list
  657.      of program and library directories gcc will search--and don't do
  658.      anything else.
  659.  
  660.      This is useful when gcc prints the error message `installation
  661.      problem, cannot exec cpp: No such file or directory'.  To resolve
  662.      this you either need to put `cpp' and the other compiler
  663.      components where gcc expects to find them, or you can set the
  664.      environment variable `GCC_EXEC_PREFIX' to the directory where you
  665.      installed them.  Don't forget the trailing '/'.  *Note Environment
  666.      Variables::.
  667.  
  668. 
  669. File: gcc.info,  Node: Optimize Options,  Next: Preprocessor Options,  Prev: Debugging Options,  Up: Invoking GCC
  670.  
  671. Options That Control Optimization
  672. =================================
  673.  
  674.    These options control various sorts of optimizations:
  675.  
  676. `-O'
  677. `-O1'
  678.      Optimize.  Optimizing compilation takes somewhat more time, and a
  679.      lot more memory for a large function.
  680.  
  681.      Without `-O', the compiler's goal is to reduce the cost of
  682.      compilation and to make debugging produce the expected results.
  683.      Statements are independent: if you stop the program with a
  684.      breakpoint between statements, you can then assign a new value to
  685.      any variable or change the program counter to any other statement
  686.      in the function and get exactly the results you would expect from
  687.      the source code.
  688.  
  689.      Without `-O', the compiler only allocates variables declared
  690.      `register' in registers.  The resulting compiled code is a little
  691.      worse than produced by PCC without `-O'.
  692.  
  693.      With `-O', the compiler tries to reduce code size and execution
  694.      time.
  695.  
  696.      When you specify `-O', the compiler turns on `-fthread-jumps' and
  697.      `-fdefer-pop' on all machines.  The compiler turns on
  698.      `-fdelayed-branch' on machines that have delay slots, and
  699.      `-fomit-frame-pointer' on machines that can support debugging even
  700.      without a frame pointer.  On some machines the compiler also turns
  701.      on other flags.
  702.  
  703. `-O2'
  704.      Optimize even more.  GNU CC performs nearly all supported
  705.      optimizations that do not involve a space-speed tradeoff.  The
  706.      compiler does not perform loop unrolling or function inlining when
  707.      you specify `-O2'.  As compared to `-O', this option increases
  708.      both compilation time and the performance of the generated code.
  709.  
  710.      `-O2' turns on all optional optimizations except for loop unrolling
  711.      and function inlining.  It also turns on frame pointer elimination
  712.      on machines where doing so does not interfere with debugging.
  713.  
  714. `-O3'
  715.      Optimize yet more.  `-O3' turns on all optimizations specified by
  716.      `-O2' and also turns on the `inline-functions' option.
  717.  
  718. `-O0'
  719.      Do not optimize.
  720.  
  721.      If you use multiple `-O' options, with or without level numbers,
  722.      the last such option is the one that is effective.
  723.  
  724.    Options of the form `-fFLAG' specify machine-independent flags.
  725. Most flags have both positive and negative forms; the negative form of
  726. `-ffoo' would be `-fno-foo'.  In the table below, only one of the forms
  727. is listed--the one which is not the default.  You can figure out the
  728. other form by either removing `no-' or adding it.
  729.  
  730. `-ffloat-store'
  731.      Do not store floating point variables in registers, and inhibit
  732.      other options that might change whether a floating point value is
  733.      taken from a register or memory.
  734.  
  735.      This option prevents undesirable excess precision on machines such
  736.      as the 68000 where the floating registers (of the 68881) keep more
  737.      precision than a `double' is supposed to have.  For most programs,
  738.      the excess precision does only good, but a few programs rely on the
  739.      precise definition of IEEE floating point.  Use `-ffloat-store' for
  740.      such programs.
  741.  
  742. `-fno-default-inline'
  743.      Do not make member functions inline by default merely because they
  744.      are defined inside the class scope (C++ only).  Otherwise, when
  745.      you specify `-O', member functions defined inside class scope are
  746.      compiled inline by default; i.e., you don't need to add `inline'
  747.      in front of the member function name.
  748.  
  749. `-fno-defer-pop'
  750.      Always pop the arguments to each function call as soon as that
  751.      function returns.  For machines which must pop arguments after a
  752.      function call, the compiler normally lets arguments accumulate on
  753.      the stack for several function calls and pops them all at once.
  754.  
  755. `-fforce-mem'
  756.      Force memory operands to be copied into registers before doing
  757.      arithmetic on them.  This may produce better code by making all
  758.      memory references potential common subexpressions.  When they are
  759.      not common subexpressions, instruction combination should
  760.      eliminate the separate register-load.  I am interested in hearing
  761.      about the difference this makes.
  762.  
  763. `-fforce-addr'
  764.      Force memory address constants to be copied into registers before
  765.      doing arithmetic on them.  This may produce better code just as
  766.      `-fforce-mem' may.  I am interested in hearing about the
  767.      difference this makes.
  768.  
  769. `-fomit-frame-pointer'
  770.      Don't keep the frame pointer in a register for functions that
  771.      don't need one.  This avoids the instructions to save, set up and
  772.      restore frame pointers; it also makes an extra register available
  773.      in many functions.  *It also makes debugging impossible on some
  774.      machines.*
  775.  
  776.      On some machines, such as the Vax, this flag has no effect, because
  777.      the standard calling sequence automatically handles the frame
  778.      pointer and nothing is saved by pretending it doesn't exist.  The
  779.      machine-description macro `FRAME_POINTER_REQUIRED' controls
  780.      whether a target machine supports this flag.  *Note Registers::.
  781.  
  782. `-fno-inline'
  783.      Don't pay attention to the `inline' keyword.  Normally this option
  784.      is used to keep the compiler from expanding any functions inline.
  785.      Note that if you are not optimizing, no functions can be expanded
  786.      inline.
  787.  
  788. `-finline-functions'
  789.      Integrate all simple functions into their callers.  The compiler
  790.      heuristically decides which functions are simple enough to be worth
  791.      integrating in this way.
  792.  
  793.      If all calls to a given function are integrated, and the function
  794.      is declared `static', then the function is normally not output as
  795.      assembler code in its own right.
  796.  
  797. `-fkeep-inline-functions'
  798.      Even if all calls to a given function are integrated, and the
  799.      function is declared `static', nevertheless output a separate
  800.      run-time callable version of the function.
  801.  
  802. `-fno-function-cse'
  803.      Do not put function addresses in registers; make each instruction
  804.      that calls a constant function contain the function's address
  805.      explicitly.
  806.  
  807.      This option results in less efficient code, but some strange hacks
  808.      that alter the assembler output may be confused by the
  809.      optimizations performed when this option is not used.
  810.  
  811. `-ffast-math'
  812.      This option allows GCC to violate some ANSI or IEEE rules and/or
  813.      specifications in the interest of optimizing code for speed.  For
  814.      example, it allows the compiler to assume arguments to the `sqrt'
  815.      function are non-negative numbers and that no floating-point values
  816.      are NaNs.
  817.  
  818.      This option should never be turned on by any `-O' option since it
  819.      can result in incorrect output for programs which depend on an
  820.      exact implementation of IEEE or ANSI rules/specifications for math
  821.      functions.
  822.  
  823.    The following options control specific optimizations.  The `-O2'
  824. option turns on all of these optimizations except `-funroll-loops' and
  825. `-funroll-all-loops'.  On most machines, the `-O' option turns on the
  826. `-fthread-jumps' and `-fdelayed-branch' options, but specific machines
  827. may handle it differently.
  828.  
  829.    You can use the following flags in the rare cases when "fine-tuning"
  830. of optimizations to be performed is desired.
  831.  
  832. `-fstrength-reduce'
  833.      Perform the optimizations of loop strength reduction and
  834.      elimination of iteration variables.
  835.  
  836. `-fthread-jumps'
  837.      Perform optimizations where we check to see if a jump branches to a
  838.      location where another comparison subsumed by the first is found.
  839.      If so, the first branch is redirected to either the destination of
  840.      the second branch or a point immediately following it, depending
  841.      on whether the condition is known to be true or false.
  842.  
  843. `-fcse-follow-jumps'
  844.      In common subexpression elimination, scan through jump instructions
  845.      when the target of the jump is not reached by any other path.  For
  846.      example, when CSE encounters an `if' statement with an `else'
  847.      clause, CSE will follow the jump when the condition tested is
  848.      false.
  849.  
  850. `-fcse-skip-blocks'
  851.      This is similar to `-fcse-follow-jumps', but causes CSE to follow
  852.      jumps which conditionally skip over blocks.  When CSE encounters a
  853.      simple `if' statement with no else clause, `-fcse-skip-blocks'
  854.      causes CSE to follow the jump around the body of the `if'.
  855.  
  856. `-frerun-cse-after-loop'
  857.      Re-run common subexpression elimination after loop optimizations
  858.      has been performed.
  859.  
  860. `-fexpensive-optimizations'
  861.      Perform a number of minor optimizations that are relatively
  862.      expensive.
  863.  
  864. `-fdelayed-branch'
  865.      If supported for the target machine, attempt to reorder
  866.      instructions to exploit instruction slots available after delayed
  867.      branch instructions.
  868.  
  869. `-fschedule-insns'
  870.      If supported for the target machine, attempt to reorder
  871.      instructions to eliminate execution stalls due to required data
  872.      being unavailable.  This helps machines that have slow floating
  873.      point or memory load instructions by allowing other instructions
  874.      to be issued until the result of the load or floating point
  875.      instruction is required.
  876.  
  877. `-fschedule-insns2'
  878.      Similar to `-fschedule-insns', but requests an additional pass of
  879.      instruction scheduling after register allocation has been done.
  880.      This is especially useful on machines with a relatively small
  881.      number of registers and where memory load instructions take more
  882.      than one cycle.
  883.  
  884. `-fcaller-saves'
  885.      Enable values to be allocated in registers that will be clobbered
  886.      by function calls, by emitting extra instructions to save and
  887.      restore the registers around such calls.  Such allocation is done
  888.      only when it seems to result in better code than would otherwise
  889.      be produced.
  890.  
  891.      This option is enabled by default on certain machines, usually
  892.      those which have no call-preserved registers to use instead.
  893.  
  894. `-funroll-loops'
  895.      Perform the optimization of loop unrolling.  This is only done for
  896.      loops whose number of iterations can be determined at compile time
  897.      or run time.  `-funroll-loop' implies both `-fstrength-reduce' and
  898.      `-frerun-cse-after-loop'.
  899.  
  900. `-funroll-all-loops'
  901.      Perform the optimization of loop unrolling.  This is done for all
  902.      loops and usually makes programs run more slowly.
  903.      `-funroll-all-loops' implies `-fstrength-reduce' as well as
  904.      `-frerun-cse-after-loop'.
  905.  
  906. `-fno-peephole'
  907.      Disable any machine-specific peephole optimizations.
  908.  
  909. 
  910. File: gcc.info,  Node: Preprocessor Options,  Next: Assembler Options,  Prev: Optimize Options,  Up: Invoking GCC
  911.  
  912. Options Controlling the Preprocessor
  913. ====================================
  914.  
  915.    These options control the C preprocessor, which is run on each C
  916. source file before actual compilation.
  917.  
  918.    If you use the `-E' option, nothing is done except preprocessing.
  919. Some of these options make sense only together with `-E' because they
  920. cause the preprocessor output to be unsuitable for actual compilation.
  921.  
  922. `-include FILE'
  923.      Process FILE as input before processing the regular input file.
  924.      In effect, the contents of FILE are compiled first.  Any `-D' and
  925.      `-U' options on the command line are always processed before
  926.      `-include FILE', regardless of the order in which they are
  927.      written.  All the `-include' and `-imacros' options are processed
  928.      in the order in which they are written.
  929.  
  930. `-imacros FILE'
  931.      Process FILE as input, discarding the resulting output, before
  932.      processing the regular input file.  Because the output generated
  933.      from FILE is discarded, the only effect of `-imacros FILE' is to
  934.      make the macros defined in FILE available for use in the main
  935.      input.
  936.  
  937.      Any `-D' and `-U' options on the command line are always processed
  938.      before `-imacros FILE', regardless of the order in which they are
  939.      written.  All the `-include' and `-imacros' options are processed
  940.      in the order in which they are written.
  941.  
  942. `-idirafter DIR'
  943.      Add the directory DIR to the second include path.  The directories
  944.      on the second include path are searched when a header file is not
  945.      found in any of the directories in the main include path (the one
  946.      that `-I' adds to).
  947.  
  948. `-iprefix PREFIX'
  949.      Specify PREFIX as the prefix for subsequent `-iwithprefix' options.
  950.  
  951. `-iwithprefix DIR'
  952.      Add a directory to the second include path.  The directory's name
  953.      is made by concatenating PREFIX and DIR, where PREFIX was
  954.      specified previously with `-iprefix'.  If you have not specified a
  955.      prefix yet, the directory containing the installed passes of the
  956.      compiler is used as the default.
  957.  
  958. `-iwithprefixbefore DIR'
  959.      Add a directory to the main include path.  The directory's name is
  960.      made by concatenating PREFIX and DIR, as in the case of
  961.      `-iwithprefix'.
  962.  
  963. `-isystem DIR'
  964.      Add a directory to the beginning of the second include path,
  965.      marking it as a system directory, so that it gets the same special
  966.      treatment as is applied to the standard system directories.
  967.  
  968. `-nostdinc'
  969.      Do not search the standard system directories for header files.
  970.      Only the directories you have specified with `-I' options (and the
  971.      current directory, if appropriate) are searched.  *Note Directory
  972.      Options::, for information on `-I'.
  973.  
  974.      By using both `-nostdinc' and `-I-', you can limit the include-file
  975.      search path to only those directories you specify explicitly.
  976.  
  977. `-undef'
  978.      Do not predefine any nonstandard macros.  (Including architecture
  979.      flags).
  980.  
  981. `-E'
  982.      Run only the C preprocessor.  Preprocess all the C source files
  983.      specified and output the results to standard output or to the
  984.      specified output file.
  985.  
  986. `-C'
  987.      Tell the preprocessor not to discard comments.  Used with the `-E'
  988.      option.
  989.  
  990. `-P'
  991.      Tell the preprocessor not to generate `#line' directives.  Used
  992.      with the `-E' option.
  993.  
  994. `-M'
  995.      Tell the preprocessor to output a rule suitable for `make'
  996.      describing the dependencies of each object file.  For each source
  997.      file, the preprocessor outputs one `make'-rule whose target is the
  998.      object file name for that source file and whose dependencies are
  999.      all the `#include' header files it uses.  This rule may be a
  1000.      single line or may be continued with `\'-newline if it is long.
  1001.      The list of rules is printed on standard output instead of the
  1002.      preprocessed C program.
  1003.  
  1004.      `-M' implies `-E'.
  1005.  
  1006.      Another way to specify output of a `make' rule is by setting the
  1007.      environment variable `DEPENDENCIES_OUTPUT' (*note Environment
  1008.      Variables::.).
  1009.  
  1010. `-MM'
  1011.      Like `-M' but the output mentions only the user header files
  1012.      included with `#include "FILE"'.  System header files included
  1013.      with `#include <FILE>' are omitted.
  1014.  
  1015. `-MD'
  1016.      Like `-M' but the dependency information is written to a file made
  1017.      by replacing ".c" with ".d" at the end of the input file names.
  1018.      This is in addition to compiling the file as specified--`-MD' does
  1019.      not inhibit ordinary compilation the way `-M' does.
  1020.  
  1021.      In Mach, you can use the utility `md' to merge multiple dependency
  1022.      files into a single dependency file suitable for using with the
  1023.      `make' command.
  1024.  
  1025. `-MMD'
  1026.      Like `-MD' except mention only user header files, not system
  1027.      header files.
  1028.  
  1029. `-MG'
  1030.      Treat missing header files as generated files and assume they live
  1031.      in the same directory as the source file.  If you specify `-MG',
  1032.      you must also specify either `-M' or `-MM'.  `-MG' is not
  1033.      supported with `-MD' or `-MMD'.
  1034.  
  1035. `-H'
  1036.      Print the name of each header file used, in addition to other
  1037.      normal activities.
  1038.  
  1039. `-AQUESTION(ANSWER)'
  1040.      Assert the answer ANSWER for QUESTION, in case it is tested with a
  1041.      preprocessing conditional such as `#if #QUESTION(ANSWER)'.  `-A-'
  1042.      disables the standard assertions that normally describe the target
  1043.      machine.
  1044.  
  1045. `-DMACRO'
  1046.      Define macro MACRO with the string `1' as its definition.
  1047.  
  1048. `-DMACRO=DEFN'
  1049.      Define macro MACRO as DEFN.  All instances of `-D' on the command
  1050.      line are processed before any `-U' options.
  1051.  
  1052. `-UMACRO'
  1053.      Undefine macro MACRO.  `-U' options are evaluated after all `-D'
  1054.      options, but before any `-include' and `-imacros' options.
  1055.  
  1056. `-dM'
  1057.      Tell the preprocessor to output only a list of the macro
  1058.      definitions that are in effect at the end of preprocessing.  Used
  1059.      with the `-E' option.
  1060.  
  1061. `-dD'
  1062.      Tell the preprocessing to pass all macro definitions into the
  1063.      output, in their proper sequence in the rest of the output.
  1064.  
  1065. `-dN'
  1066.      Like `-dD' except that the macro arguments and contents are
  1067.      omitted.  Only `#define NAME' is included in the output.
  1068.  
  1069. `-trigraphs'
  1070.      Support ANSI C trigraphs.  The `-ansi' option also has this effect.
  1071.  
  1072. `-Wp,OPTION'
  1073.      Pass OPTION as an option to the preprocessor.  If OPTION contains
  1074.      commas, it is split into multiple options at the commas.
  1075.  
  1076. 
  1077. File: gcc.info,  Node: Assembler Options,  Next: Link Options,  Prev: Preprocessor Options,  Up: Invoking GCC
  1078.  
  1079. Passing Options to the Assembler
  1080. ================================
  1081.  
  1082.    You can pass options to the assembler.
  1083.  
  1084. `-Wa,OPTION'
  1085.      Pass OPTION as an option to the assembler.  If OPTION contains
  1086.      commas, it is split into multiple options at the commas.
  1087.  
  1088. 
  1089. File: gcc.info,  Node: Link Options,  Next: Directory Options,  Prev: Assembler Options,  Up: Invoking GCC
  1090.  
  1091. Options for Linking
  1092. ===================
  1093.  
  1094.    These options come into play when the compiler links object files
  1095. into an executable output file.  They are meaningless if the compiler is
  1096. not doing a link step.
  1097.  
  1098. `OBJECT-FILE-NAME'
  1099.      A file name that does not end in a special recognized suffix is
  1100.      considered to name an object file or library.  (Object files are
  1101.      distinguished from libraries by the linker according to the file
  1102.      contents.)  If linking is done, these object files are used as
  1103.      input to the linker.
  1104.  
  1105. `-c'
  1106. `-S'
  1107. `-E'
  1108.      If any of these options is used, then the linker is not run, and
  1109.      object file names should not be used as arguments.  *Note Overall
  1110.      Options::.
  1111.  
  1112. `-lLIBRARY'
  1113.      Search the library named LIBRARY when linking.
  1114.  
  1115.      It makes a difference where in the command you write this option;
  1116.      the linker searches processes libraries and object files in the
  1117.      order they are specified.  Thus, `foo.o -lz bar.o' searches
  1118.      library `z' after file `foo.o' but before `bar.o'.  If `bar.o'
  1119.      refers to functions in `z', those functions may not be loaded.
  1120.  
  1121.      The linker searches a standard list of directories for the library,
  1122.      which is actually a file named `libLIBRARY.a'.  The linker then
  1123.      uses this file as if it had been specified precisely by name.
  1124.  
  1125.      The directories searched include several standard system
  1126.      directories plus any that you specify with `-L'.
  1127.  
  1128.      Normally the files found this way are library files--archive files
  1129.      whose members are object files.  The linker handles an archive
  1130.      file by scanning through it for members which define symbols that
  1131.      have so far been referenced but not defined.  But if the file that
  1132.      is found is an ordinary object file, it is linked in the usual
  1133.      fashion.  The only difference between using an `-l' option and
  1134.      specifying a file name is that `-l' surrounds LIBRARY with `lib'
  1135.      and `.a' and searches several directories.
  1136.  
  1137. `-lobjc'
  1138.      You need this special case of the `-l' option in order to link an
  1139.      Objective C program.
  1140.  
  1141. `-nostartfiles'
  1142.      Do not use the standard system startup files when linking.  The
  1143.      standard system libraries are used normally, unless `-nostdlib' or
  1144.      `-nodefaultlibs' is used.
  1145.  
  1146. `-nodefaultlibs'
  1147.      Do not use the standard system libraries when linking.  Only the
  1148.      libraries you specify will be passed to the linker.  The standard
  1149.      startup files are used normally, unless `-nostartfiles' is used.
  1150.  
  1151. `-nostdlib'
  1152.      Do not use the standard system startup files or libraries when
  1153.      linking.  No startup files and only the libraries you specify will
  1154.      be passed to the linker.
  1155.  
  1156.      One of the standard libraries bypassed by `-nostdlib' and
  1157.      `-nodefaultlibs' is `libgcc.a', a library of internal subroutines
  1158.      that GNU CC uses to overcome shortcomings of particular machines,
  1159.      or special needs for some languages.  (*Note Interfacing to GNU CC
  1160.      Output: Interface, for more discussion of `libgcc.a'.) In most
  1161.      cases, you need `libgcc.a' even when you want to avoid other
  1162.      standard libraries.  In other words, when you specify `-nostdlib'
  1163.      or `-nodefaultlibs' you should usually specify `-lgcc' as well.
  1164.      This ensures that you have no unresolved references to internal
  1165.      GNU CC library subroutines.  (For example, `__main', used to
  1166.      ensure C++ constructors will be called; *note `collect2':
  1167.      Collect2..)
  1168.  
  1169. `-s'
  1170.      Remove all symbol table and relocation information from the
  1171.      executable.
  1172.  
  1173. `-static'
  1174.      On systems that support dynamic linking, this prevents linking
  1175.      with the shared libraries.  On other systems, this option has no
  1176.      effect.
  1177.  
  1178. `-shared'
  1179.      Produce a shared object which can then be linked with other
  1180.      objects to form an executable.  Only a few systems support this
  1181.      option.
  1182.  
  1183. `-symbolic'
  1184.      Bind references to global symbols when building a shared object.
  1185.      Warn about any unresolved references (unless overridden by the
  1186.      link editor option `-Xlinker -z -Xlinker defs').  Only a few
  1187.      systems support this option.
  1188.  
  1189. `-Xlinker OPTION'
  1190.      Pass OPTION as an option to the linker.  You can use this to
  1191.      supply system-specific linker options which GNU CC does not know
  1192.      how to recognize.
  1193.  
  1194.      If you want to pass an option that takes an argument, you must use
  1195.      `-Xlinker' twice, once for the option and once for the argument.
  1196.      For example, to pass `-assert definitions', you must write
  1197.      `-Xlinker -assert -Xlinker definitions'.  It does not work to write
  1198.      `-Xlinker "-assert definitions"', because this passes the entire
  1199.      string as a single argument, which is not what the linker expects.
  1200.  
  1201. `-Wl,OPTION'
  1202.      Pass OPTION as an option to the linker.  If OPTION contains
  1203.      commas, it is split into multiple options at the commas.
  1204.  
  1205. `-u SYMBOL'
  1206.      Pretend the symbol SYMBOL is undefined, to force linking of
  1207.      library modules to define it.  You can use `-u' multiple times with
  1208.      different symbols to force loading of additional library modules.
  1209.  
  1210.